import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '数据ID',
    dataIndex: 'dataId',
    width: 120,
  },
  {
    title: '数据类型',
    dataIndex: 'datatype_dictText',
  },
  {
    title: '文件ID',
    dataIndex: 'fileId',
  },
  {
    title: '批次',
    dataIndex: 'batchNo',
  },
  {
    title: '错误类型',
    dataIndex: 'ruleCode_dictText',
  },
  {
    title: '处理状态',
    dataIndex: 'proState_dictText',
  },
  {
    title: '报错时间',
    dataIndex: 'createTime',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    label: '数据类型',
    field: 'datatype',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'datatype',
      type: 'select',
    },
  },
  {
    label: '错误类型',
    field: 'ruleCode',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'ruleCode',
      type: 'select',
    },
  },
  {
    label: '报错时间',
    field: 'createTime',
    component: 'RangePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD HH:mm:ss',
      format: 'YYYY-MM-DD HH:mm:ss',
      placeholder: ['请选择开始时间', '请选择结束时间'],
    },
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  { label: '', field: 'id', component: 'Input', show: false },
  {
    label: '数据ID',
    field: 'dataId',
    component: 'Input',
  },
  {
    label: '数据类型',
    field: 'datatype',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'datatype',
      type: 'select',
    },
  },
  {
    label: 'fileId',
    field: 'fileId',
    component: 'Input',
  },
  {
    label: 'orgId',
    field: 'orgId',
    component: 'Input',
  },
  {
    label: 'batchNo',
    field: 'batchNo',
    component: 'Input',
  },
  {
    label: '错误类型',
    field: 'ruleCode',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'ruleCode',
      type: 'select',
    },
  },
  {
    label: '报错时间',
    field: 'createTime',
    component: 'Input',
  },
];
